<?php
namespace app\index\model;

use think\Model;

class Register extends Model
{

    protected $connection = [
        //'database'=> 'userdb',
        'prefix' => 'd_',
    ];

    // 关闭update_time字段自动写入
    protected $updateTime = false;

    // 重写父类初始化方法
    protected function initialize()
    {
        parent::initialize();
        $this->table = 'd_register';
    }

    // 关联方法
    public function userCharacter()
    {
        // 用户HAS Many角色关联
        return $this->hasMany('UserCharacter');
    }
}
